//
//  NoImageCell.m
//  Product_NEWS
//
//  Created by dllo on 16/1/4.
//  Copyright © 2016年 FCH. All rights reserved.
//

#define titleLabel_X  10 * SCREEN_WIDTH
#define titleLabel_Y 5 *SCREEN_HEIGHT
#define WIDTH ([UIScreen mainScreen].bounds.size.width)
#define HEIGHT ([UIScreen mainScreen].bounds.size.height )


#import "NoImageCell.h"
@interface NoImageCell ()
@property(nonatomic,retain)titleLabel *titleLabel;  //主题
@property (nonatomic, retain) WordTite *sourceLabel;  //文章来源
@property(nonatomic,retain)UIView *lineView; // 灰线
@property(nonatomic,retain)UIImageView *back;
@end

@implementation NoImageCell


-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubviews];
        
    }
    return self;
}



-(void)createSubviews
{
    self.titleLabel = [[titleLabel alloc]initWithFrame:CGRectMake(titleLabel_X, titleLabel_Y, WIDTH - titleLabel_X, 20 * SCREEN_HEIGHT)];
    
    self.titleLabel.font = [UIFont systemFontOfSize:16*SCREEN_WIDTH];

    [self.contentView addSubview:self.titleLabel];
    [_titleLabel release];
    
    self.lineView = [[UIView alloc]initWithFrame:CGRectMake(titleLabel_X, titleLabel_Y + 30 * SCREEN_HEIGHT, WIDTH - 2 * titleLabel_X, SCREEN_HEIGHT)];
    self.lineView.backgroundColor = [NightModeHandle shareNightModeHandle].allViewColor;
    [self.contentView addSubview:self.lineView];
    [_lineView release];
    
    self.sourceLabel = [[WordTite alloc]initWithFrame:CGRectMake(titleLabel_X, titleLabel_Y + 40 *SCREEN_HEIGHT , 100 * SCREEN_HEIGHT, 20 * SCREEN_WIDTH)];
    self.sourceLabel.font = [UIFont systemFontOfSize:13*SCREEN_WIDTH];
    [self.contentView addSubview:self.sourceLabel];
    [_sourceLabel release];
    
    UIView *view = [[UIView alloc]initWithFrame:CGRectMake(0, titleLabel_Y + 60 * SCREEN_HEIGHT, 375 * SCREEN_WIDTH, 20 * SCREEN_HEIGHT)];
    view.backgroundColor = [NightModeHandle shareNightModeHandle].allViewColor;

    [self.contentView addSubview:view];
    
    self.back = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 375 * SCREEN_WIDTH, 65 * SCREEN_HEIGHT)];
    CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
    self.back.layer.borderColor = CGColorCreate(colorSpace,(CGFloat[]){ 188/255.0, 193/255.0, 183/255.0, 1 });
    [self.back.layer setMasksToBounds:YES];
    self.back.layer.cornerRadius=2;
    [self.back.layer setBorderWidth:1.0];
    [self.contentView addSubview:self.back];

    
    
    
    
}

-(void)setModel:(ReadListModel *)model{
    
    if (_model != model) {
        [_model release];
        _model = [model retain];
    }
    
    
    self.titleLabel.text = model.title;
    self.sourceLabel.text = model.source;
    
    
    
}







@end
